/**
 * 问题： 'default' is not exported by src/common/qqmap-wx-jssdk.min.js, imported by src/utils/QQMapSDK.js
 * 处理方法： module.exports = QQMapWX;   修改成   export default QQMapWX;
 */

import QQMapWX from '../common/plugin/qqmap-wx-jssdk.min.js'

const QQMapSDK = new QQMapWX({ key: '57YBZ-2YNLX-4A74V-7Y52P-IIPAT-ACBMO' })

export function getCurrentPosition() {
  return new Promise((resolve, reject) => {
    QQMapSDK.reverseGeocoder({
      success(res) {
        resolve(res)
      },
      fail(err) {
        console.log(err)
        reject(err)
      }
    })
  })
}
